# -*- coding: utf-8 -*-
from django.db import models
from django.template.defaultfilters import default
from datetime import date

class Pessoa(models.Model):
    
    nome = models.CharField('Nome', max_length=200)
    cpf = models.CharField('CPF', max_length=14, null=True, blank=True)
    rg = models.CharField('RG', max_length=50, null=True, blank=True)
    orgaoExpedidor = models.CharField('Orgao Expedidor', max_length=6, null=True, blank=True)
    dataNascimento = models.DateField('Data de Nascimento', null=True, blank=True)
    dataAtualizacao = models.DateField('Data de Atualizacao', default=date.today, null=True, blank=True)
    email1 = models.EmailField('e-mail', null=True, blank=True)
    email2 = models.EmailField('e-mail 2', null=True, blank=True)
    email3 = models.EmailField('e-mail 3', null=True, blank=True)
    telefone1 = models.CharField('Telefone Residencial', max_length=20, null=True, blank=True)    
    telefone2 = models.CharField('Telefone Comercial', max_length=20, null=True, blank=True)    
    telefone3 = models.CharField('Celular 1', max_length=20, null=True, blank=True)    
    telefone4 = models.CharField('Celular 2', max_length=20, null=True, blank=True)    
    profissao = models.CharField('Profissao', max_length=50, null=True, blank=True)
    
    def dataNascimentoFormatada(self):
        return str(self.dataNascimento.strftime('%d/%m/%Y'))
    dataNascimentoFormatada.short_description = 'Data de Nascimento'
    
    def dataAtualizacaoFormatada(self):
        return str(self.dataAtualizacao.strftime('%d/%m/%Y'))
    dataAtualizacaoFormatada.short_description = 'Data de Atualizacao'
    
    def __unicode__(self):
        return self.nome
    
    class Meta():
        app_label = 'intercampi'
